package com.hjc.service;

import org.apache.log4j.Logger;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterThrowing;
import org.springframework.beans.factory.annotation.Autowired;

public class PlayerError {

    private static  final Logger log= Logger.getLogger(PlayerError.class);
    @AfterThrowing (pointcut = "execution (public void updateEquip(com.hjc.service.Equip))")
    public void before(JoinPoint jp)  {

        Equip e= (Equip) jp.getArgs()[0];
        if (e != null && "指环".equals(e.getType())) {


            System.out.println("活动期间，可以免费将任意指环升级为“紫色梦幻”指环");
            e.setName("紫色梦幻" + e.getName());
            e.setAttackPlus(e.getAttackPlus() + 6);
            e.setDefencePlus(e.getDefencePlus() + 6);

        } else {

            System.out.println("非指环类装备");
        }
    }

}
